﻿#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<map>
#include<string>
using namespace std;
int main()
{
	map<int, int> mp;
	pair<int, int > s1(1, 2);
	mp.insert(s1);
	mp.insert(pair<int, int>(11, 2));
	mp.insert({ 221,2 });
	auto it1 = mp.begin();
	while (it1 != mp.end())
	{
		cout << it1->first << ":" << it1->second << " ";
		//cout << (*it).first << ";" << (*it).second << " ";
		it1++;
	}
	cout << endl;
	map<string, string> dict = { {"left", "左边"}, {"right", "右边"},{"insert", "插⼊"},{ "string", "字符串" } };

//map<string, string>::iterator it = dict.begin();
auto it = dict.begin();
while (it != dict.end())
{
	//it->second = 2;
cout << it->first << ":" << it->second << endl;
++it;
}
cout << endl;
	multimap<string, string> dict1;
	dict1.insert({ "sort", "" });
	dict1.insert({ "sort", "" });
	dict1.insert({ "sort", "xxxx" });
	dict1.insert({ "left", "" });

	//dict.erase("sort");
	auto itpair = dict1.equal_range("sort");
	auto it22 = itpair.first;
	while (it22 != itpair.second)
	{
		cout << it22->first << ":" << it22->second << endl;
		++it22;
	}
	cout << endl;
	return 0;
}